<template>
  <div class="app-tabbar">
    <tabbar :list="list"></tabbar>
  </div>
</template>

<script>
import Tabbar from './Tabbar.vue'
import routes from '@/router/routes'

export default {
  name: 'AppTabbar',
  computed: {
    list() {
      const result = routes.map(route => {
        if (route.meta && route.meta.inTabbar) {
          return {
            icon: route.meta.icon,
            text: route.meta.title,
            pagePath: route.path,
          }
        }
        return null
      })
        .filter(item => item)
      return result
    },
  },
  components: {
    Tabbar,
  },
}
</script>

<style lang="less" scoped>

</style>
